package com.setup.trac.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.setup.trac.pojo.StoricoTicket;
import com.setup.trac.pojo.condition.StoricoTicketFinderByIdStorico;
import com.setup.trac.service.SearchService;

public class ShowDescrizioneStorico extends AbstractController {

	private SearchService searchService;
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		ModelAndView mav = new ModelAndView("showDescrizione");
		String idStorico = request.getParameter("idStorico");
		StoricoTicket st = getSearchService().find(new StoricoTicket[0], new StoricoTicketFinderByIdStorico(idStorico), StoricoTicket.class)[0];
		request.setAttribute("storicoSelected", st);
		return mav;
	}
	public SearchService getSearchService() {
		return searchService;
	}
	public void setSearchService(SearchService searchService) {
		this.searchService = searchService;
	}

}
